import { createApp } from "vue";
import router from "./router";
import App from "./App.vue";
import ElementPlus from "element-plus";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
import "element-plus/dist/index.css";
import zhCn from "element-plus/es/locale/lang/zh-cn.mjs";
// import "./style/index.scss";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import { createPinia } from "pinia";
import utils from "./utils/index.js";

const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
// 创建应用实例
const app = createApp(App);

// 注册插件
app.use(utils);
app.use(pinia);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
   app.component(key, component)
}


console.log(router);

// 注册路由和ElementPlus
app.use(ElementPlus, { locale: zhCn });
app.use(router);

// 挂载应用
app.mount("#app");